package com.lukk.TEST;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.transaction.annotation.Transactional;

import com.lukk.pojo.PotentialWorker;
import com.lukk.service.IInternalWorkerService;
import com.lukk.service.IPotentialWorkerService;
import com.lukk.service.IWorkerService;

/**
 * 
 * SpringServiceTest 下午12:26:26 Copyright zhaocj Inc. All Rights reserved.
 * alldios@outlook.com
 *
 */
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath*:/applicationContext.xml" })
@Transactional
public class SpringServiceTest {
	@Autowired
	private IPotentialWorkerService potentialWorkerService;

	public IPotentialWorkerService getPotentialWorkerService() {
		return potentialWorkerService;
	}

	public void setPotentialWorkerService(IPotentialWorkerService potentialWorkerService) {
		this.potentialWorkerService = potentialWorkerService;
	}

	@Autowired
	private IInternalWorkerService internalWorkerService;

	public IInternalWorkerService getInternalWorkerService() {
		return internalWorkerService;
	}

	public void setInternalWorkerService(IInternalWorkerService internalWorkerService) {
		this.internalWorkerService = internalWorkerService;
	}

	@Test
	public void test1() throws Exception {
		PotentialWorker pWorker = new PotentialWorker();
		pWorker.setCreateTime("11111");
		pWorker.setInternalWorkerID(111);
		pWorker.setPhoneNumber("11111");
		pWorker.setWorkerName("11111");
		potentialWorkerService.insertPotentialWorker(pWorker);
	}

	@Test
	public void test2() throws Exception {
		PotentialWorker pWorker = new PotentialWorker();
		pWorker.setPhoneNumber("11111");

	}

	@Test
	public void test3() throws Exception {
		Integer integer = potentialWorkerService.deleteByPhone("13233844503");
		System.out.println(integer);
	}
}
